<template>
    <!--adminHeader是一个恒定固定在网页上方的页眉-->
    <div class="header">
        <div class="header-content">
            <div class="header-title">学生组织管理系统SOMS</div>
            <div class="header-user">
                <span class="user-name">欢迎你！用户{{ userName }}</span>
                <div class="header-logout">
                    <RouterLink to="/adminLogIn">退出登录</RouterLink>
                </div>
            </div>
        </div>
    </div>
</template>
<script setup>
import { ref } from 'vue';
import { RouterLink } from 'vue-router';
const userName = ref(localStorage.getItem('adminId')); // 用户名变量
</script>
<style lang='scss' scoped>
.header {
  width: 100%;
  height: 60px;
  background-color: #05b6f6;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(5, 182, 246, 0.08);

  .header-content {
    width: 100%;
    max-width: 1200px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 32px;
  }

  .header-title {
    font-size: 24px;
    font-weight: bold;
    letter-spacing: 2px;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  }

  .header-user {
    display: flex;
    align-items: center;

    .user-name {
      font-size: 16px;
      color: #fff;
      font-weight: 500;
      letter-spacing: 1px;
      margin-right: 10px;
    }

    .header-logout {
      margin-left: 0;
      a {
        color: #2196f3;
        background: #e3f2fd;
        padding: 5px 16px;
        border-radius: 16px;
        font-size: 14px;
        font-weight: 500;
        text-decoration: none;
        transition: background 0.2s, color 0.2s;
        box-shadow: 0 2px 8px rgba(33,150,243,0.08);
        &:hover {
          background: #bbdefb;
          color: #1565c0;
        }
      }
    }
  }
}
</style>